﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Xml;
using System.Collections.ObjectModel;

namespace HomeServerData
{
    public class TabItemData
    {

        private string _header;
        private string _contentText;
        private XmlDataProvider _content;
        private XmlNode _xmlcontent;

        public TabItemData(string header, XmlDataProvider content)
        {

            _header = header;
            _content = content; 
            _xmlcontent = content.Document;
            _contentText = content.ToString();
        }

        public string Header
        {
            get { return _header; }
        }



        public XmlDataProvider Content
        {
            get { return _content; }
        }

        public XmlNode XmlContent
        {
            get { return _xmlcontent; }
        }
        public string XmlContentText
        {
            get { return _contentText; }
        }
    }
    public class TabList : ObservableCollection<TabItemData>
    {

        public TabList()
            : base()
        {
            XmlDataProvider FoldersXmlDataProvider = new XmlDataProvider();
            FoldersXmlDataProvider.Document = new XmlDocument();
            FoldersXmlDataProvider.Document.Load("Folders.xml");
            FoldersXmlDataProvider.XPath = "ServerSharedInfomation/SharedFolders";

            Add(new TabItemData("Library", FoldersXmlDataProvider));
            Add(new TabItemData("Media Player", FoldersXmlDataProvider));

        }

    }
}
namespace HomeServer
{
    /// <summary>
    /// Interaction logic for HomeServerPanel.xaml
    /// </summary>
    
    public partial class HomeServerPanel : Window
    {
        public XmlDataProvider ShareFoldersXmlDataProvider { get; set; }

        public HomeServerPanel()
        {
            InitializeComponent();

            ItemCollection items = TabLibraries.Items;

            
            int Count = items.Count;
            for (int i = 0; i < Count; i++)
            {
               object Item = items.GetItemAt(i);
               string strItem = Item.ToString();
            }

            //ShareFoldersXmlDataProvider = this.FindResource("ShareListViewXmlData") as XmlDataProvider;

            //ShareFoldersXmlDataProvider = new XmlDataProvider();
            //this.ShareFoldersXmlDataProvider.Document = new XmlDocument();
            //this.ShareFoldersXmlDataProvider.Document.Load("Folders.xml");
            //this.ShareFoldersXmlDataProvider.XPath = "ServerSharedInfomation/SharedFolders";
            //Binding b = new Binding();
            //b.Mode = BindingMode.OneWay;
            //b.Source = ShareFoldersXmlDataProvider;
            //b.XPath = "Folder";
            //ServerShareFolersListView.SetBinding(ListView.ItemsSourceProperty, b);
        }
    }


}
